Optimal. Leaf size=85 \[ \frac {2 a \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d \sqrt {a-b} \sqrt {a+b}}+\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}-\frac {x}{b^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.12, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3022, 12, 2735, 2659, 205} \[ \frac {2 a \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{b^2 d \sqrt {a-b} \sqrt {a+b}}+\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}-\frac {x}{b^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 205
Rule 2659
Rule 2735
Rule 3022
Rubi steps
\begin {align*} \int \frac {1-\cos ^2(c+d x)}{(a+b \cos (c+d x))^2} \, dx &=\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}-\frac {\int \frac {\left (a^2-b^2\right ) \cos (c+d x)}{a+b \cos (c+d x)} \, dx}{b \left (a^2-b^2\right )}\\ &=\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}-\frac {\int \frac {\cos (c+d x)}{a+b \cos (c+d x)} \, dx}{b}\\ &=-\frac {x}{b^2}+\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}+\frac {a \int \frac {1}{a+b \cos (c+d x)} \, dx}{b^2}\\ &=-\frac {x}{b^2}+\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}+\frac {(2 a) \operatorname {Subst}\left (\int \frac {1}{a+b+(a-b) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^2 d}\\ &=-\frac {x}{b^2}+\frac {2 a \tan ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{\sqrt {a-b} b^2 \sqrt {a+b} d}+\frac {\sin (c+d x)}{b d (a+b \cos (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.25, size = 80, normalized size = 0.94 \[ -\frac {\frac {2 a \tanh ^{-1}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {b^2-a^2}}\right )}{\sqrt {b^2-a^2}}-\frac {b \sin (c+d x)}{a+b \cos (c+d x)}+c+d x}{b^2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.55, size = 376, normalized size = 4.42 \[ \left [-\frac {2 \, {\left (a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (a^{3} - a b^{2}\right )} d x + {\left (a b \cos \left (d x + c\right ) + a^{2}\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{2} b^{3} - b^{5}\right )} d \cos \left (d x + c\right ) + {\left (a^{3} b^{2} - a b^{4}\right )} d\right )}}, -\frac {{\left (a^{2} b - b^{3}\right )} d x \cos \left (d x + c\right ) + {\left (a^{3} - a b^{2}\right )} d x - {\left (a b \cos \left (d x + c\right ) + a^{2}\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (a^{2} b - b^{3}\right )} \sin \left (d x + c\right )}{{\left (a^{2} b^{3} - b^{5}\right )} d \cos \left (d x + c\right ) + {\left (a^{3} b^{2} - a b^{4}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.39, size = 140, normalized size = 1.65 \[ -\frac {\frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {a^{2} - b^{2}}}\right )\right )} a}{\sqrt {a^{2} - b^{2}} b^{2}} + \frac {d x + c}{b^{2}} - \frac {2 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + a + b\right )} b}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.08, size = 116, normalized size = 1.36 \[ \frac {2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d b \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) b +a +b \right )}+\frac {2 a \arctan \left (\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (a -b \right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{d \,b^{2} \sqrt {\left (a -b \right ) \left (a +b \right )}}-\frac {2 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d \,b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.87, size = 277, normalized size = 3.26 \[ \frac {2\,\left (-a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}+a^2\,\mathrm {atan}\left (\frac {\left (a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}\right )\,1{}\mathrm {i}\right )}{b^2\,d\,\sqrt {b^2-a^2}\,\left (a+b\,\cos \left (c+d\,x\right )\right )}+\frac {2\,\left (\frac {\sin \left (c+d\,x\right )\,\sqrt {b^2-a^2}}{2}-\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\sqrt {b^2-a^2}+a\,\mathrm {atan}\left (\frac {\left (a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )-b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}\right )\,\cos \left (c+d\,x\right )\,1{}\mathrm {i}\right )}{b\,d\,\sqrt {b^2-a^2}\,\left (a+b\,\cos \left (c+d\,x\right )\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________